﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Compilex.Automata;

namespace Metex
{
    public class StubSubmachineTransition<S> : SimpleTransitionRule<S>
    {
        public StubSubmachineTransition(S returnState, string submachineName)
            : base("_$"+submachineName+"$_", returnState)
        {
        }

        //public override bool IsEpsilon
        //{
        //    get
        //    {
        //        return true;
        //    }
        //}

        public override bool MatchesInput(string input)
        {
            if (input.StartsWith("_$") && input.EndsWith("$_"))
                return base.MatchesInput(input);
            else
                return input == Input[2].ToString();
        }

    }
}
